$(function () {
    //获取当前页面的url
    var url = window.location.href;
    //获取url中的参数
    var id = url.split("?")[1].split("=")[1];
    //传回后台
    var data = {
        "userId": id,
    }
    var url = '/queryTenantsListById';
    commonAjaxPost(true, url, data, function (result) {
        if (result.code === "666") {
            var data = result.data;
            console.log(data);
            var project_remaining = data.project_remaining;
            var questionnaire_remaining = data.questionnaire_remaining;
            var answer_remaining = data.answer_remaining;
            var project_num = data.project_num;
            var questionnaire_num = data.questionnaire_num;
            var answer_num = data.answer_num;

            $("#balance").text(data.property);
            $("#space").text(project_remaining);
            $("#questionnaire").text(questionnaire_remaining);
            $("#answer").text(answer_remaining);
            $("#usedSpace").text(project_num);
            $("#usedQuestionnaire").text(questionnaire_num);
            $("#usedAnswer").text(answer_num);
            //剩余空间数目/剩余数目+已用数目，显示百分比条
            //若分母为0，则显示0%
            if (project_remaining + project_num === 0) {
            } else {
            }
        } else {
            layer.msg(result.message, {icon: 2});
        }
    });
});
